package personnel.department.pages;

import java.lang.reflect.Field;
import java.util.List;

import personnel.department.utils.TranslatorUtils;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;

public class SearchContent {
	
	private Multimap<String, Field> fieldsByName = LinkedListMultimap.create();
	private List<Field> fields;
	
	public SearchContent(List<Field> fields) {
		this.fields = fields;
	}
	
	public Multimap<String, Field> getContent() {
		for (Field field : fields) {
			String type = TranslatorUtils.getClassName(field.getDeclaringClass().getSimpleName());
			if (type == null) {
				continue;
			}
			fieldsByName.put(type, field);
		}
		return fieldsByName;
	}

}
